<?php

namespace common\models\hospital;

use Yii;

/**
 * This is the model class for table "{{%history_address}}".
 *
 * @property string $card_id 诊疗号
 * @property string|null $truename 患者姓名
 * @property int|null $project_id 项目id
 * @property string|null $address 身份证地址
 * @property string|null $work_unit 居住地地址
 */
class HistoryAddress extends \common\models\BaseModel
{
    /**
     * {@inheritdoc}
     */
    public static function tableName()
    {
        return '{{%history_address}}';
    }

    /**
     * @return \yii\db\Connection the database connection used by this AR class.
     */
    public static function getDb()
    {
        return Yii::$app->get('db3');
    }

    /**
     * {@inheritdoc}
     */
    public function rules()
    {
        return [
            [['card_id'], 'required'],
            [['project_id'], 'integer'],
            [['card_id'], 'string', 'max' => 20],
            [['truename', 'address', 'work_unit'], 'string', 'max' => 255],
            [['card_id'], 'unique'],
        ];
    }

    /**
     * {@inheritdoc}
     */
    public function attributeLabels()
    {
        return [
            'card_id' => '诊疗号',
            'truename' => '患者姓名',
            'project_id' => '项目id',
            'address' => '身份证地址',
            'work_unit' => '居住地地址',
        ];
    }
}
